/*
 * global_rainbow_table.h
 *
 *  Created on: Aug 31, 2010
 *      Author: ofer
 */

#ifndef GLOBAL_RAINBOW_TABLE_H_
#define GLOBAL_RAINBOW_TABLE_H_
#include "../global/global_declarations.h"
#include "../global/misc.h"

typedef char* (*ReductionFunctionPtr)(int seed, int64 input);

typedef struct {
	char dictionary_filename[80];
	int rainbow_chain_length;
	int64 entries_in_hash_table;
	int bucket_block_length;
	char rule[80];
	char main_random_seed[80];
} IniFileContent;

bool read_ini_file(IniFileContent* /* out */content, char* ini_file_name);
void do_chain_hashing(int chain_length, String* first_pass, int64* seed_arr,
		BasicHashFunctionPtr hash_func, int hash_length, unsigned char* dest,
		bool do_first_hashing, int starting_index);
void cut_to_the_data(char* line);
void int64_to_word(int64 src, String* dest);

#endif /* GLOBAL_RAINBOW_TABLE_H_ */
